﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Visitor
{
    class ConcreteElementRoot : IElement
    {
        IElement[] elements;

        public ConcreteElementRoot()
        {
            this.elements = new IElement[]
            {
                new ConcreteElement1(), new ConcreteElement2()
            };
        }



        public void accept(IVisitor visitor)
        {
            foreach (var element in elements)
            {
                element.accept(visitor);
            }
            visitor.visit(this);
        }
    }
}
